import * as categoryApi from '@/api/category';

export default {
  namespaced: true,
  state() {
    return {
      categoryList: {},
    };
  },
  mutations: {
    SET_CATEGORY(state, newValue) {
      state.categoryList = newValue;
    },
  },
  actions: {
    async upCategory({ commit }, id) {
      const res = await categoryApi.category(id);
      commit('SET_CATEGORY', res);
    },
  },
};
